package com.qxsx.midi.activity.personal;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.qxsx.midi.R;
import com.qxsx.midi.activity.base.BaseActivity;
import com.qxsx.midi.widget.wheelView.addressView.AddrView;

/**
 * Created by LYJ on 2015/9/8.
 */
public class PersonalEditPostionActivity extends BaseActivity implements View.OnClickListener {
    private RelativeLayout rl_mess, rl_name, rl_email, rl_position, rl_password, rl_phonenum;
    private LinearLayout ll_back, ll_save;
    private TextView tv_pos;
    private AddrView areaSelector;
    Intent intent = new Intent();
    String proviceName;
    String cityName;
    String districtName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_personal_position);
        setTitle("所在地");
        setNavBtn(R.mipmap.back, 0);
        tv_pos = (TextView) findViewById(R.id.tv_pos);
        areaSelector = (AddrView) findViewById(R.id.area_selector);
        areaSelector.setVisibility(View.VISIBLE);

        // 选择地区
        areaSelector.setOnOkListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String area = "";
                area = area + areaSelector.getSelectedProviceName() + areaSelector.getSelectedCityName() + areaSelector.getSelectedDistrictName();
                proviceName = areaSelector.getSelectedProviceName();
                cityName = areaSelector.getSelectedCityName();
                districtName = areaSelector.getSelectedDistrictName();
                tv_pos.setText(area);
            }
        });

    }

    @Override
    protected void HandleTitleBarEvent(TitleBar component, View v) {
        switch (component) {
            case LEFT:
                finish();
                break;
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
        }
    }

}
